class TestThread2 implements Runnable {
    public void run() {
        while (true) {
            System.out.println("Hello: " + Thread.currentThread().getId());
            System.out.println("Hello: " + Thread.currentThread().getName());
            System.out.println("Hello: " + Thread.currentThread().getState());
            try {
                Thread.sleep(1000);
            } catch (InterruptedException e) {
                throw new RuntimeException(e);
            }
        }
    }
}

public class Demo2 {

    public static void main(String[] args) throws InterruptedException {
        Thread t = new Thread(new TestThread2());
        t.start();

        while (true) {
            System.out.println("Hello: " + Thread.currentThread().getId());
            System.out.println("Hello: " + Thread.currentThread().getName());
            System.out.println("Hello: " + Thread.currentThread().getState());

            Thread.sleep(3000);
            break;
        }
        System.out.println("hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh");
    }
}
